package com.dddd.blog.blogsp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dddd.blog.blogsp.entity.Blog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author 喵星球的大橘
 */
@Mapper
public interface BlogContentMapper extends BaseMapper<Blog> {

    /**
     * @param blog
     * @return
     */
    @Insert("insert into pms_post(uuid,author,title,content,create_time,tags,read_count,comment_count,link) values(" +
            "#{uuid},#{author},#{title},#{content},#{createTime},#{tags},#{readCount},#{commentCount},#{link})")
    int addPost(Blog blog);



    /**
     * 添加文章列表
     * @param records
     * @return
     */
    int addPostList(Map<String,Blog> records);


    /**
     * 获取文章Map列表
     * @return
     */
    List<Map<String,Object>> getPostList();

}
